﻿using System;
using System.ComponentModel.DataAnnotations;
using MSAcademic.v2.Infrastructure.Login;
using MSAcademic.v2.Infrastructure.User;

namespace MSAcademic.v2.Web.Areas.Admin.Models.User
{
    public partial class ChangeProfilePictureViewModel
    {
        public int Id { get; set; }
        [Required(ErrorMessage = "Polje ne smije biti prazno")]
        public string Url { get; set; }

        public string ErrorMessage { get; set; }
    }
    public partial class ChangeProfilePictureViewModel
    {
        public IUser SignedInUser
        {
            get
            {
                if (_signedInUser == null)
                {
                    _signedInUser = new Lazy<IUser>(() => _loginService.TryGetSignedInUser());
                }
                return _signedInUser.Value;
            }
        }
        private Lazy<IUser> _signedInUser;
    }
    public partial class ChangeProfilePictureViewModel
    {
        private readonly ILoginService _loginService;
        public ChangeProfilePictureViewModel(ILoginService loginService)
        {
            _loginService = loginService;
        }
    }
}